import { authGet, get, post } from '../fetch.js'
export default {
    // 配置列表。el-tree格式
    // 参数type=?
    // type: community-小区，section-直辖单位
    settingList(params = {}) {
        return authGet('/api/setting/list', params)
    },
    areaList(params = {}) {
        return authGet('/api/setting/areaList', params)
    },
    // 修改配置
    // 参数{"id":?,"type":?,"action":?,"name":?,"parent_id":?}
    // type: community-小区，section-直辖单位
    // action: add-添加 edit-编辑 delete-删除
    handleSetting(params = {}) {
        return post('/api/setting/handle', params)
    },
    // 设备列表
    // 参数 ?page=?&
    deviceList(params = {}) {
        return post('/api/device/list', params)
    },
    // 编辑设备
    handleDevice(params = {}) {
        return post('/api/device/handle', params)
    },
    importDevice(params = {}) {
        return post('/api/device/import', params)
    },
    // 激活设备
    activeDevice(params = {}) {
        return post('/api/device/active', params)
    },
    // 用户（客户）列表
    userList(params = {}) {
        return authGet('/api/user/list', params)
    },
    // 编辑用户（客户）
    handleUser(params = {}) {
        return post('/api/user/handle', params)
    },
    // 联系人列表
    contactList(params = {}) {
        return authGet('/api/contact/list', params)
    },
    // 编辑联系人
    handleContact(params = {}) {
        return post('/api/contact/handle', params)
    },
    // 传感器类型
    sensorTypes(params = {}) {
        return authGet('/api/sensor/types', params)
    },
    // 编辑传感器类型
    handleSensorType(params = {}) {
        return post('/api/sensor/handle', params)
    },
    // 任务列表
    taskList(params = {}) {
        return authGet('/api/task/list', params)
    },
    // 编辑任务
    handleTask(params = {}) {
        return post('/api/task/handle', params)
    },
    taskInfo(params = {}) {
        return authGet('/api/task/info', params)
    },
    // 组织列表。el-tree格式
    organizationList(params = {}) {
        return authGet('/api/organization/list', params)
    },
    organizationTopList(params = {}) {
        return authGet('/api/organization/topList', params)
    },
    // 修改组织
    // 参数{"id":?,"action":?,"name":?,"parent_id":?}
    // action: add-添加 edit-编辑 delete-删除
    handleOrganization(params = {}) {
        return post('/api/organization/handle', params)
    },
    tenantList(params = {}) {
        return authGet('/api/tenant/list', params)
    },
    handleTenant(params = {}) {
        return post('/api/tenant/handle', params)
    },
    roleList(params = {}) {
        return authGet('/api/role/list', params)
    },
    permissionList(params = {}) {
        return authGet('/api/role/permissionList', params)
    },
    handleRole(params = {}) {
        return post('/api/role/handle', params)
    },
    bind(params = {}) {
        return post('/api/user/bind', params)
    },
    unBind(params = {}) {
        return post('/api/user/unBind', params)
    },
    zoneList(params = {}) {
        return authGet('/api/zoneList', params)
    },
    markers(params = {}) {
        return authGet('/api/device/markers', params)
    },
    alarmLogs(params = {}) {
        return authGet('/api/device/alarmLogs', params)
    },
    sensorList(params = {}) {
        return authGet('/api/device/sensor', params)
    },
    importTemplate(params = {}) {
        return authGet('/api/device/importTemplate', params)
    },
    importRecord(params = {}) {
        return authGet('/api/device/importRecord', params)
    },
    deviceInfo(params = {}) {
        return authGet('/api/device/info', params)
    },
    exportAlarmRecord(params = {}) {
        return post('/api/device/exportAlarmRecord', params)
    },
    getSummarizeData(params = {}) {
        return authGet('/api/dashboard', params)
    },
    loginByAlexa(params = {}) {
        return post('/alexa/auth', params)
    },
    getDeviceInfoBySN(params = {}) {
        return authGet('/app/g1/device/info',params)
    },
    childDeviceInfo(params = {}) {
        return authGet('/app/g1/childDeviceInfo',params)
    },
    producerUnbind(params = {}) {
        return authGet('/api/device/producer/unbind',params)
    }
}

